package com.itheima.log.service.impl;


import com.itheima.log.aop.LogRec;
import com.itheima.log.common.LogType;
import com.itheima.log.dao.AccountDao;
import com.itheima.log.domain.Account;
import com.itheima.log.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDao accountDao;

    @LogRec(type = LogType.insert,desc = "添加了数据")
    public void save(Account account) {
        accountDao.save(account);
    }

    @LogRec(type = LogType.update,desc = "修改了数据")
    public void update(Account account) {
        accountDao.update(account);
    }

    @LogRec(type = LogType.delect,desc = "删除了数据")
    public void delete(Integer id) {
        accountDao.delete(id);
    }

    @LogRec(type = LogType.find,desc = "查询了数据")
    public Account findById(Integer id) {
        return accountDao.findById(id);
    }

}
